<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-07-31 17:46:49
 * @LastEditTime : 2020-01-14 15:39:48
 * @LastEditors  : Please set LastEditors
 -->
<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport"
		content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<title>Hello APP</title>
	<link rel="stylesheet" type="text/css" href="../../css/vant.css">
	<link rel="stylesheet" type="text/css" href="../../css/base.css" />
	<script type="text/javascript" src="../../script/jquery.js"></script>
	<script type="text/javascript" src="../../script/layer/mobile/layer.js"></script>
	<script type="text/javascript" src="../../script/vue.min.js"></script>
	<script type="text/javascript" src="../../script/vant.min.js"></script>
	<script type="text/javascript" src="../../script/fastclick.js"></script>
	<script type="text/javascript" src="../../script/base.js"></script>
	<style type="text/css">
		.data {
			margin-top: 5px;
		}

		.data .row {
			margin-top: 5px;
		}

		.sort {
			display: inline-block;
			width: 20px;
			height: 20px;
			line-height: 20px;
			font-size: 12px;
			text-align: center;
			background: #cd1b21;
			color: #fff;
			border-radius: 4px;
			margin-right: 5px;
		}

		.data .row .sub {
			color: #9e9e9e;
			font-size: 12px;
		}

		.data .row .sub-bold {
			font-weight: 700;
			color: #000;
		}

		.required {
			color: #cd1b21;
			display: inline-block;
			width: 5px;
		}

		.hidden {
			visibility: hidden;
		}

		.a-c {
			display: inline-block;
			padding: 15px;
		}
	</style>
</head>

<body>
	<div id="app" v-cloak>
		<div class="init-full">
			<van-nav-bar class="head" :title="titleName" left-arrow @click-left="onClickLeft">
				<div slot="right" class="head-right">
					<span @click="showSearch = true;">
						<img src="../../image/search.png" />
					</span>
				</div>
			</van-nav-bar>
			<div class="body-with-bottom">
				<div class="content">

					<van-list v-model="listLoading" :finished="listFinished" finished-text="没有更多了" @load="listOnLoad">
						<div class="data">
							<div class="row" v-for="(row,rowIndex) in tableData" @click="toggleChecked(row)">
								<van-cell>
									<div>
										<span class="sort">{{rowIndex + 1}}</span>
										<span>{{row[columns[0].colName]}}</span>
									</div>
									<div slot="right-icon" v-if="row.checked">
										<van-checkbox v-model="row.checked" shape="square" slot="right-icon" />
									</div>
								</van-cell>
								<van-cell>
									<van-row>
										<van-col :span="12" v-for="(item,itemIndex) in columns"
											v-if="itemIndex != 0 && !item.isHidden">
											<div class="sub b">
												<span>{{item.colDesc}}：</span>
												<span>{{row[item.colName]}}</span>
											</div>
										</van-col>
									</van-row>
								</van-cell>
							</div>
						</div>
					</van-list>
				</div>
				<van-loading v-if="showLoading" />
			</div>
			<div class="bottom">
				<div class="bottom-left-label">
					<span class="a-c" @click="toggleAllCheck">
						<van-checkbox v-model="allChecked" shape="round"></van-checkbox>
					</span>
				</div>
				<div class="bottom-right-button">
					<van-button type="primary" block @click="selectArrayConfirm">确定</van-button>
				</div>
			</div>

			<van-popup v-model="showDatePicker" position="bottom">
				<van-datetime-picker v-model="currentDate" cancel-button-text="清空" type="date" @cancel="clearDatePicker"
					@confirm="confirmDatePicker" />
			</van-popup>

			<van-popup v-model="showSearch" round position="bottom">
				<div v-for="(formRow,index1) in formDesign">
					<div v-for="(formCol,index2) in formRow.controls">
						<van-field v-if="formCol.baseProperty.controlType=='textbox'"
							:readonly="formCol.baseProperty.isReadOnly" @change="dataChange(formCol)"
							v-model="formData[formCol.baseProperty.controlName]">
							<div slot="label"><span
									:class="formCol.baseProperty.isRequired?'required':'hidden'">*</span>{{formCol.baseProperty.labelName}}
							</div>
						</van-field>
						<van-field v-else-if="formCol.baseProperty.controlType=='number'"
							:label="formCol.baseProperty.labelName" :readonly="formCol.baseProperty.isReadOnly"
							@change="dataChange(formCol)" v-model="formData[formCol.baseProperty.controlName]"
							type="number">
							<div slot="label"><span
									:class="formCol.baseProperty.isRequired?'required':'hidden'">*</span>{{formCol.baseProperty.labelName}}
							</div>
						</van-field>
						<van-cell v-else-if="formCol.baseProperty.controlType=='hidden'"
							:title="formCol.baseProperty.labelName" :value="formData[formCol.baseProperty.controlName]"
							style="display:none;">
						</van-cell>
						<van-cell
							v-else-if="formCol.baseProperty.controlType=='select' && formCol.controlProperty.select.type == 1"
							:value="getsimpleSelectText(index1,index2,formCol)" is-link arrow-direction="down"
							@click="openSimpleSelect(index1,index2,formCol)">
							<div slot="title"><span
									:class="formCol.baseProperty.isRequired?'required':'hidden'">*</span>{{formCol.baseProperty.labelName}}
							</div>
						</van-cell>
						<van-cell
							v-else-if="formCol.baseProperty.controlType=='select' && formCol.controlProperty.select.type == 3"
							:value="formCol.controlProperty.select.actualName || ''" is-link
							@click="openComplexSelect(index1,index2,formCol)">
							<div slot="title"><span
									:class="formCol.baseProperty.isRequired?'required':'hidden'">*</span>{{formCol.baseProperty.labelName}}
							</div>
						</van-cell>
						<van-cell v-else-if="formCol.baseProperty.controlType=='datepicker'"
							:value="(formData[formCol.baseProperty.controlName] || '').replace(/T/g,' ')"
							@click="openDatePicker(index1,index2,formCol)">
							<div slot="title"><span
									:class="formCol.baseProperty.isRequired?'required':'hidden'">*</span>{{formCol.baseProperty.labelName}}
							</div>
							<van-icon slot="right-icon" name="../../image/date.png" size="18"
								style="line-height: inherit;"></van-icon>
						</van-cell>
					</div>
				</div>
				<div class="btn-padding">
					<van-button type="primary" block style="border-radius: 0;" @click="searchList">查询</van-button>
				</div>
			</van-popup>
		</div>
	</div>
</body>

<script type="text/javascript">
	var vm;

	apiready = function () {
		//$('.init-full').show();

		var billRole = JSON.parse(window.localStorage.getItem('billRole'))


		function getBillRoleList(data) {
			let filterSQL = "";
			let moduleName = data.replace(/app_/g, '');
			let billList = billRole.filter(item => item.FListName == moduleName);
			if (billList.length > 0) {
				if (billList[0]["T_Value"] != '-1') {
					filterSQL += '(';
					//权限业务逻辑
					let colTypes = [];//已执行过的类型列
					let colSQLType = [];//多类型SQL集合
					billList.forEach(item => {
						if (item["SC_ColA"]) {
							if (colTypes.filter(x => x == item["SC_ColA"]).length == 0) {
								let sc_colAs = [];
								let sc_colBs = [];
								let current_filterSQL = "";
								let current_billType = billList.filter(x => x["SC_ColA"] == item["SC_ColA"]);
								for (var i = 0; i < current_billType.length; i++) {
									sc_colAs.push("'" + current_billType[i]["T_Value"] + "'");
									if (current_billType[i]["SC_ColB"]) {
										sc_colBs.push("'" + current_billType[i]["T_Value"] + "'");
									}
								}
								if (sc_colAs.length > 0) {
									current_filterSQL += ' ' + item["SC_ColA"] + " in (" + sc_colAs.join(",") + ")"
									if (sc_colBs.length > 0) {
										current_filterSQL += " or " + current_billType[0]["SC_ColB"] + " in (" + sc_colBs.join(",") + ") "
									}
								}
								if (current_filterSQL) {
									current_filterSQL = " (" + current_filterSQL + ") ";
									colSQLType.push(current_filterSQL);
								}
								colTypes.push(item["SC_ColA"]);
							}
						}
					})
					filterSQL += colSQLType.join(" and ");
					filterSQL += " ) "
				}
			}
			return filterSQL;
		}

		api.addEventListener({
			name: 'selectImportRow'
		}, function (ret, err) {
			var row = ret.value.row;
			var formCol = vm.formDesign[vm.simpleSelectIndex[0]].controls[vm.simpleSelectIndex[1]];
			vm.formData[formCol.baseProperty.controlName] = row[formCol.controlProperty.select.hiddenValue];
			formCol.controlProperty.select.actualName = row[formCol.controlProperty.select.displayValue];
			vm.selectData[formCol.baseProperty.controlName] = row;
			vm.$set(formCol.controlProperty.select, "sqlDataSource", [row]);
			vm.$set(formCol.controlProperty.select, "originDataSource", [row]);

			if (formCol.controlProperty.select.change != "") {
				vm.selectDataChange(formCol);
			}
		})

		//复杂下拉选单选选中
		api.addEventListener({
			name: 'selectImportArray'
		}, function (ret, err) {
			var array = ret.value.array;
			var formCol = vm.formDesign[vm.simpleSelectIndex[0]].controls[vm.simpleSelectIndex[1]];
			var idArray = [];
			var textArray = [];
			for (var i in array) {
				idArray.push(array[i][formCol.controlProperty.select.hiddenValue])
				textArray.push(array[i][formCol.controlProperty.select.displayValue])
			}
			vm.formData[formCol.baseProperty.controlName] = idArray.join();
			formCol.controlProperty.select.actualName = textArray.join();
		})

		var titleName = api.pageParam.titleName;

		vm = new Vue({
			el: '#app',
			data: {
				showLoading: false,
				listLoading: false,
				listFinished: true,
				showSearch: false,
				showDatePicker: false,
				currentDate: new Date(),
				simpleSelectIndex: [0, 0],
				allChecked: false,
				selectArray: [],
				titleName: titleName,
				columns: [],
				tableData: [],
				childFormList: [],
				formDesign: [],
				formData: {},
				sql: "",
				column_originConfig: [],
				column_config: [],

				params: {},
				paging: {
					pageSize: 30,
					pageIndex: 0,
					totalCount: 0
				},
				selections: []
			},
			created: function () {
				var that = this;
				setTimeout(function () {
					that.initDataEvent(api.pageParam.initData);
				}, 200)

			},
			methods: {
				toggleAllCheck(){
					var that = this;
					that.allChecked = !that.allChecked;
					for(var i in that.tableData){
						if(that.allChecked){
							this.$set(that.tableData[i], 'checked', true);
						}else{
							this.$set(that.tableData[i], 'checked', false);
						}
					}
				},
				toggleChecked(row) {
					var that = this;
					if (typeof row.checked === 'undefined') {
						this.$set(row, 'checked', true);
					} else {
						row.checked = !row.checked;
					}
					var x = 0;
					for(var i in that.tableData){
						if(that.tableData[i].checked){
							x++;
						}
					}
					if(x == that.tableData.length){
						that.allChecked = true;
					}else{
						that.allChecked = false;
					}
				},
				initDataEvent(options) {
					vm.sql = options.sql;
					if (options.childFormList == null) {
						options.childFormList = [];
					}
					vm.childFormList = options.childFormList;
					var rowDesignFormData = [];
					for (var i = 0; i < options.formDesign.length; i++) {
						//增加查询默认值
						if (options.formDesign[i].baseProperty.defaultValue && options.formDesign[i].baseProperty.defaultValue.indexOf('@') >= 0) {
							if (options.originFormData && options.originFormData[options.formDesign[i].baseProperty.defaultValue.substring(1)]) {
								vm.$set(vm.formData, options.formDesign[i].baseProperty.controlName, options.originFormData[options.formDesign[i].baseProperty.defaultValue.substring(1)]);
							}
							else {
								vm.$set(vm.formData, options.formDesign[i].baseProperty.controlName, "");
							}
						}
						else {
							vm.$set(vm.formData, options.formDesign[i].baseProperty.controlName, vm.getSYDefaultValue(options.formDesign[i].baseProperty.defaultValue));
						}
						var rowId = options.formDesign[i].baseProperty.rowId;
						if (options.formDesign[i].baseProperty.controlType == "select") {
							//下拉框数据加载
							if (options.formDesign[i].controlProperty.select.type < 3) {
								var sql = options.formDesign[i].controlProperty.select.dataSource;
								$.ajax({
									url: "http://"+ FLD.serverIP +"/SQLData/GetDataBySql",
									async: false,
									data: {
										programId: localStorage.getItem("programId"),
										sql: sql
									},
									type: "post",
									dataType: 'json',
									success: function (data) {
										if (data.status == 200) {

											options.formDesign[i].controlProperty.select.actualName = '';

											options.formDesign[i].controlProperty.select.sqlDataSource = data.data.ds;
											options.formDesign[i].controlProperty.select.originDataSource = data.data.ds;

											//判断隐藏值类型和当前赋值类型是否一致
											if (data.data.ds.length > 0 && vm.formData[options.formDesign[i].baseProperty.controlName]) {
												var dataType = typeof (data.data.ds[0][options.formDesign[i].controlProperty.select.hiddenValue]);
												if (dataType != typeof (vm.formData[options.formDesign[i].baseProperty.controlName])) {
													if (dataType == "int") {
														vm.formData[options.formDesign[i].baseProperty.controlName] = parseInt(vm.formData[options.formDesign[i].baseProperty.controlName]);
													}
													else if (dataType == "boolean") {
														vm.formData[options.formDesign[i].baseProperty.controlName] = Boolean(parseInt(vm.formData[options.formDesign[i].baseProperty.controlName]));
													}
												}
												else {
													vm.formData[options.formDesign[i].baseProperty.controlName] = vm.formData[options.formDesign[i].baseProperty.controlName];
												}

												if (dataType != typeof (options.formDesign[i].baseProperty.defaultValue)) {
													if (dataType == "int") {
														options.formDesign[i].baseProperty.defaultValue = parseInt(options.formDesign[i].baseProperty.defaultValue);
													}
													else if (dataType == "boolean") {
														options.formDesign[i].baseProperty.defaultValue = Boolean(parseInt(options.formDesign[i].baseProperty.defaultValue));
													}
												}
												for (var j in data.data.ds) {
													if (options.formDesign[i].baseProperty.defaultValue == data.data.ds[j][options.formDesign[i].controlProperty.select.hiddenValue]) {
														options.formDesign[i].controlProperty.select.actualName = data.data.ds[j][options.formDesign[i].controlProperty.select.displayValue]
													}
												}

											}

										}
									}
								});
							} else if (options.formDesign[i].controlProperty.select.type == 3) {
								var valueList = [];
								if (vm.formData[options.formDesign[i].baseProperty.controlName] != undefined && vm.formData[options.formDesign[i].baseProperty.controlName] != "") {
									valueList.push("'" + vm.formData[options.formDesign[i].baseProperty.controlName] + "'");
								}
								var sql = "select * from (" + options.formDesign[i].controlProperty.select.dataSource + ")t";
								if (valueList.length > 0) {
									sql += " where " + options.formDesign[i].controlProperty.select.hiddenValue + " in (" + valueList.join(',') + ") ";
									$.ajax({
										url: "http://"+ FLD.serverIP +"/SQLData/GetDataBySql",
										async: false,
										data: {
											programId: localStorage.getItem("programId"),
											sql: sql
										},
										type: "post",
										dataType: 'json',
										success: function (data) {
											if (data.status == 200) {
												vm.$set(options.formDesign[i].controlProperty.select, "sqlDataSource", data.data.ds);
												vm.$set(options.formDesign[i].controlProperty.select, "originDataSource", data.data.ds);
												//绑定固定值
												vm.$set(options.formDesign[i].controlProperty.select, "actualName", "");
												var actualList = data.data.ds.filter(function (item) { return item[options.formDesign[i].controlProperty.select.hiddenValue] == vm.formData[options.formDesign[i].baseProperty.controlName] });
												if (actualList.length > 0) {
													vm.$set(options.formDesign[i].controlProperty.select, "actualName", actualList[0][options.formDesign[i].controlProperty.select.displayValue]);

												}
											}
										}
									});
								} else {
									vm.$set(options.formDesign[i].controlProperty.select, "sqlDataSource", []);
									vm.$set(options.formDesign[i].controlProperty.select, "originDataSource", []);
									vm.$set(options.formDesign[i].controlProperty.select, "actualName", "");
								}
							}
						}

						var designDataList = rowDesignFormData.filter(function (item) { return item.rowId == rowId; });
						if (designDataList.length > 0) {
							designDataList[0].controls.push(options.formDesign[i]);
						}
						else {
							rowDesignFormData.push({
								rowId: rowId,
								controls: [options.formDesign[i]]
							});
						}
					}
					vm.formDesign = rowDesignFormData;
					vm.columns = options.columns;

					vm.searchList();
				},
				//系统默认常量时间
				getSYDefaultValue(funcName) {
					if (funcName.indexOf("getdate()") >= 0) {
						var date;
						if (funcName == "getdate()") {
							date = new Date();
						} else {
							date = new Date();
							Date.prototype.DateAdd = function (strInterval, Number) {
								var dtTmp = this;
								switch (strInterval) {
									case 's': return new Date(Date.parse(dtTmp) + (1000 * Number));
									case 'n': return new Date(Date.parse(dtTmp) + (60000 * Number));
									case 'h': return new Date(Date.parse(dtTmp) + (3600000 * Number));
									case 'd': return new Date(Date.parse(dtTmp) + (86400000 * Number));
									case 'w': return new Date(Date.parse(dtTmp) + ((86400000 * 7) * Number));
									case 'q': return new Date(dtTmp.getFullYear(), (dtTmp.getMonth()) + Number * 3, dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());
									case 'm': return new Date(dtTmp.getFullYear(), (dtTmp.getMonth()) + Number, dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());
									case 'y': return new Date((dtTmp.getFullYear() + Number), dtTmp.getMonth(), dtTmp.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp.getSeconds());
								}
							}
							var addFun = funcName.split('.')[1];
							eval("date=date." + addFun);
						}
						var seperator1 = "-";
						var seperator2 = ":";
						var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
						var strDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
						var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
							+ " " + date.getHours() + seperator2 + date.getMinutes()
							+ seperator2 + date.getSeconds();
						return currentdate;
					}
					else {
						return funcName;
					}
				},
				//简单下拉选根据id显示text
				getsimpleSelectText(index1, index2, formCol) {
					var that = this;
					var sqlDataSource = formCol.controlProperty.select.sqlDataSource;
					var txt = '';
					for (var i in sqlDataSource) {
						if (sqlDataSource[i][that.formDesign[index1].controls[index2].controlProperty.select.hiddenValue] == that.formData[formCol.baseProperty.controlName]) {
							txt = sqlDataSource[i][that.formDesign[index1].controls[index2].controlProperty.select.displayValue];
						}
					}
					return txt || ' ';
				},
				//打开简单下拉选
				openSimpleSelect(index1, index2, formCol) {
					var that = this;
					if (formCol.baseProperty.isReadOnly) {
						return false;
					}
					that.simpleSelectIndex = [index1, index2]
					that.columns = formCol.controlProperty.select.sqlDataSource;
					for (var i in that.columns) {
						if (that.columns[i][that.formDesign[that.simpleSelectIndex[0]].controls[that.simpleSelectIndex[1]].controlProperty.select.displayValue] === null) {
							that.columns[i][that.formDesign[that.simpleSelectIndex[0]].controls[that.simpleSelectIndex[1]].controlProperty.select.displayValue] = '';
						}
					}
					that.showSimpleSelect = true;
				},
				//简单下拉选选中
				simpleSelectChange(value, index) {
					var that = this;
					var formCol = that.formDesign[that.simpleSelectIndex[0]].controls[that.simpleSelectIndex[1]];
					that.formData[formCol.baseProperty.controlName] = formCol.controlProperty.select.sqlDataSource[index][formCol.controlProperty.select.hiddenValue];
					// formCol.controlProperty.select.actualName = value[formCol.controlProperty.select.displayValue];
					that.showSimpleSelect = false;
				},
				//打开复杂下拉选
				openComplexSelect(index1, index2, formCol) {
					var that = this;
					if (formCol.baseProperty.isReadOnly) {
						return false;
					}
					that.simpleSelectIndex = [index1, index2];
					var filter = formCol.controlProperty.select.formSQL;
					for (var key in that.formData) {
						var value = "'" + that.formData[key] + "'";
						filter = eval("filter.replace(/" + "@" + key + "/g,value)")
					}
					api.openWin({
						name: '复杂筛选' + formCol.controlProperty.url,
						url: 'formConfigScreen.html',
						reload: true,
						slidBackEnabled: false,
						pageParam: {
							filter: filter,
							screenName: formCol.controlProperty.select.url,
							allowClear: false,
							type: formCol.controlProperty.select.chooseType,
							isDetail: false,
							isImport: true,
							objName: api.pageParam.objName
						}
					})
				},
				//打开日期选择器
				openDatePicker(index1, index2, formCol) {
					var that = this;
					if (formCol.baseProperty.isReadOnly) {
						return false;
					}
					that.simpleSelectIndex = [index1, index2];
					that.currentDate = new Date(that.formData[formCol.baseProperty.controlName]);
					that.showDatePicker = true;
				},
				//清空所选日期
				clearDatePicker() {
					var that = this;
					var formCol = that.formDesign[that.simpleSelectIndex[0]].controls[that.simpleSelectIndex[1]];
					that.formData[formCol.baseProperty.controlName] = '';
					that.showDatePicker = false;
				},
				//确认当前所选日期
				confirmDatePicker(value) {
					var that = this;
					var formCol = that.formDesign[that.simpleSelectIndex[0]].controls[that.simpleSelectIndex[1]];
					that.formData[formCol.baseProperty.controlName] = FLD.getFormatDate(value).split(' ')[0];
					that.showDatePicker = false;
				},

				listOnLoad() {
					vm.paging.pageIndex++;

					var searchParam = [];
					for (var key in vm.formData) {
						searchParam.push({
							Key: key,
							Value: vm.formData[key]
						})
					}
					$.ajax({
						url: "http://"+ FLD.serverIP +"/SQLData/GetDataBySql",
						async: true,
						data: {
							programId: localStorage.getItem("programId"),
							sql: vm.sql,
							sqlParam: searchParam
						},
						type: "post",
						dataType: 'json',
						success: function (data) {
							vm.listLoading = false;
							if (data.status == 200) {
								//返回数据本身
								vm.tableData = vm.tableData.concat(data.data.ds);
								vm.paging.totalCount = vm.tableData.length;
								if (data.data.ds.length == 0) {
									vm.listFinished = true;
								}
							}
						}
					});





				},
				//验证必填项
				valitedRequired() {
					var resultObj = { status: 200, msg: "" };
					for (var i = 0; i < vm.formDesign.length; i++) {
						for (var j = 0; j < vm.formDesign[i].controls.length; j++) {
							if (vm.formDesign[i].controls[j].baseProperty.isRequired) {
								if (vm.formData[vm.formDesign[i].controls[j].baseProperty.controlName] == "" || vm.formData[vm.formDesign[i].controls[j].baseProperty.controlName] == null) {
									resultObj = {
										status: 500,
										msg: vm.formDesign[i].controls[j].baseProperty.labelName + "字段不能为空!"
									};
								}
							}
						}
					}
					return resultObj;
				},
				//查询数据
				searchList() {

					//验证必填项
					var valitedResult = vm.valitedRequired();
					if (valitedResult.status == 500) {
						layer.msg(valitedResult.msg);
						return;
					} else {
						var searchParam = [];
						for (var key in vm.formData) {
							searchParam.push({
								Key: key,
								Value: vm.formData[key]
							})
						}
						vm.showSearch = false;
						vm.paging.pageIndex = 1;
						$.ajax({
							url: "http://"+ FLD.serverIP +"/SQLData/GetDataBySql",
							async: true,
							data: {
								programId: localStorage.getItem("programId"),
								sql: vm.sql,
								sqlParam: searchParam
							},
							type: "post",
							dataType: 'json',
							success: function (data) {
								vm.listFinished = false;
								vm.listFinished = true;
								if (data.status == 200) {
									//返回数据本身
									vm.tableData = data.data.ds;
									vm.paging.totalCount = vm.tableData.length;
								}
							}
						});
					}
				},
				selectArrayConfirm() {
					var that = this;
					var selections = []
					for (var i in that.tableData) {
						if (that.tableData[i].checked) {
							selections.push(that.tableData[i]);
						}
					}
					api.sendEvent({
						name: 'selectImportData',
						extra: {
							columns: that.columns,
							selections: selections
						}
					});
					api.closeWin();
				},
				onClickLeft() {
					api.closeWin();
				}
			}
		})
	};
</script>

</html>